{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.61803398874989"
      ]
     },
     "execution_count": 3,
     "metadata": {
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "N(golden_ratio)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "8916004529\n",
      "5510393843\n",
      "3405610686\n",
      "2104783157\n",
      "1300827529\n",
      "803955628\n",
      "496871901\n",
      "307083727\n",
      "189788174\n",
      "117295553\n",
      "72492621\n",
      "44802932\n",
      "27689689\n",
      "17113243\n",
      "10576446\n",
      "6536797\n",
      "4039649\n",
      "2497148\n",
      "1542501\n",
      "954647\n",
      "587854\n",
      "366793\n",
      "221061\n",
      "145732\n",
      "75329\n",
      "70403\n",
      "4926\n",
      "65477\n",
      "-60551\n"
     ]
    }
   ],
   "source": [
    "p=random_prime(10^10)\n",
    "print(p)\n",
    "c=ceil(p/golden_ratio)\n",
    "print(c)\n",
    "b=p-c\n",
    "print(b)\n",
    "a=c-b\n",
    "while a>=0:\n",
    "    print(a)\n",
    "    c=b\n",
    "    b=a\n",
    "    a=c-b\n",
    "print(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "170141183460469231731687303715884105726\n",
      "170141183460469231731687303715884105727\n"
     ]
    }
   ],
   "source": [
    "n=2^127-2\n",
    "print(n)\n",
    "p=next_probable_prime(n)\n",
    "print(p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
   ],
   "source": [
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "SageMath (stable)",
   "language": "sagemath",
   "metadata": {
    "cocalc": {
     "description": "Open-source mathematical software system",
     "priority": 10,
     "url": "https://www.sagemath.org/"
    }
   },
   "name": "sagemath"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.15"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}